package com.gw2.gw2world;

import com.gw2.gw2world.controller.NavigationManager;
import com.gw2.gw2world.controller.Tools;

import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.app.Activity;
import android.content.res.Configuration;

//Arah,Balthazar,Dwayna,Grenth,Lyssa,Melandru,CoE,CoF ->5*3=15 DL
/** Display selected dungeon or temple status from the same region (Europe or North America).
 * It will run download event info separately to avaid user waiting
 * @author Seb
 */
public class TempleDungeonActivity extends Activity {
	@SuppressWarnings("unused")
	private static final String TAG="TempleDungeonActivity";
	private NavigationManager nm;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		Tools.forceLocale(this);
		setContentView(R.layout.temple_dungeon_main);
		nm=new NavigationManager(this, R.id.drawer_layout_td, R.id.left_drawer_td);
	}
	@Override
	protected void onPause() {
		Tools.unlockScreen(this);
		super.onPause();
	}
	@Override
	protected void onResume() {
		Tools.lockScreenFromPreferences(this);
		super.onResume();
	}
	@Override
    public boolean onPrepareOptionsMenu(Menu menu) {
        // If the nav drawer is open, hide action items related to the content view
        //boolean drawerOpen = nm.isDrawerOpen();
        //menu.findItem(R.id.action_websearch).setVisible(!drawerOpen);
        return super.onPrepareOptionsMenu(menu);
    }
	@Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Pass the event to ActionBarDrawerToggle, if it returns
        // true, then it has handled the app icon touch event
        if (nm.getDrawerToggle().onOptionsItemSelected(item)) {
          return true;
        }
		return super.onOptionsItemSelected(item);
	}
	@Override
    protected void onPostCreate(Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);
        // Sync the toggle state after onRestoreInstanceState has occurred.
        nm.getDrawerToggle().syncState();
    }

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        // Pass any configuration change to the drawer toggles
        nm.getDrawerToggle().onConfigurationChanged(newConfig);
    }
}
